A technique for suppressing trapping for the boundary between two color areas where one is a thin line by testing the number of pixels which make up the thickness of the areas, the decision being based on run length encoded image data
The technique of trapping provides a perceptual remedy for misalignment or misregistration of toner separations at the boundary between two colors, the effect of which is manifested in the form of a white gap or discolored band at the boundary. The result of trapping is the placement of a thin xe2x80x9ctrappingxe2x80x9d strip at one of the two edges. The trap color is chosen to be perceptually xe2x80x9cneutralxe2x80x9d when placed in the vicinity of the color boundary, resulting in a color transition that appears artifact-free (i.e., without white gaps or overlapping colors) to the human eye when viewed from a sufficient distance.
For example, where there is a sharp edge between a dark area and a light area, the trap may replace one or more pixels at the boundary with intermediate pixels, to reduce the visual effect of any misregistration. The process usually involves determining where there is an edge between two pixels of different colors, sending a description of the two colors to a trap generator which decides which of the two edges should be changed, and to what color, and finally replacing the color of the selected pixel.
Trapping generators are described in U.S. patent applications Ser. Nos. 09/176 969, now abandoned 09/176 970, now abandoned and 09/177 276 now abandoned and trapping done on run length encoded image data is described in 09/409 541, now abandoned all of which are incorporated by reference herein.
For the typical operation, it is assumed that objects to be trapped are very large relative to the trapping region. Thus, the color of only a thin boundary will be changed, while the large internal area will have the original, correct, color. However, for objects smaller than a few pixels, trapping results in visible hue changes in the color of the entire object. For example, if a thin line is only two pixels in width, and the trap generator decides to change the color of those two pixels, the entire thin line color has been changed. If the thin line happens to be located near a larger object of the same initial color, , there will be a visible color shift along the line relative to the larger object, and the result of the trapping operation will be less desirable than no trapping at all. Therefore, a method by which trapping can be selectively suppressed for thin objects is desirable.
The prevention of thin line color shifts for data in the form of pixels can be accomplished by selectively suppressing trapping if the trapped line is thinner than a predetermined number of pixels. For example, the rule could be that if routine trapping is being applied to a two pixel boundary between areas, then trapping would be suppressed if the line is determined to be less than four pixels wide. This would guarantee that for a one pixel line, that pixel would not be changed in color, and for lines of two or more pixels, there would always be at least two pixels of the original color.
In this invention, it is assumed that the image data is run length encoded. In the this data format, contiguous pixels in the fast scan direction with the same color are grouped as xe2x80x9crunsxe2x80x9d, described by a color, a length (in number of pixels), and other common attributes. For this type of data construction, a xe2x80x9cscanlinexe2x80x9d will consist of a series of contiguous runs describing one raster line worth of image data
This trapping process proceeds as follows.
1) Collecting in a buffer a number of scanlines of run length encoded image data equal to twice the minimum line width threshold (M). For an example, assume a threshold of two pixels (M=2), so the number collected of scanlines in the buffer would be four.
2) Determining the next xe2x80x9ccenterxe2x80x9d point that may require trapping, the point being the intersection of a vertical and horizontal line. The horizontal line is always in the center of the scan lines. Thus, in the case of four lines in the buffer, the horizontal line will have two lines above and two below. The vertical line will be through the next point at which any of the four scan lines exhibits a run (color) boundary (denoted a xe2x80x9csegment boundaryxe2x80x9d). The colors of the pixels surrounding the point of intersection (upper left, upper right, lower left, lower right) are sent to the trapping generator and the color changes that should be made are received back.
3) If trapping is required in the fast scan direction, do so only if the length of the run in the fast scan direction is greater than M. That is, in the example, the trapping color change should be made only if the pixel to be changed is in a run of M or more pixels, and
4) if trapping of a run is required in the slow scan direction, do so only if there are M runs above or below of the same color.
5) repeat this sequence to find the next center point, from step 2.
6) At the end of the scan, output the topmost scan line in the buffer for printing (or further image processing), and roll the remaining scanlines up one line (e.g. scanline 2 becomes 1, 3 becomes 2, and 4 becomes 3). A new scanline of image data is then added at the bottom, and the process is repeated from step 2.
The result is a method for efficient suppression of trapping of thin objects, and an overall improvement of image quality, due to the facile nature of image data processing associated with the run length encoded format